<?php
 defined('RUN')or die('No access');class Security{private static $a=NULL;public static function setToken($b){$c=String::random(20,TRUE,TRUE,FALSE);$_SESSION['svdm_token'][$b]=$c;return $c;}public static function checkToken($b,$d){if(isset($_SESSION['svdm_token'][$b])&&$_SESSION['svdm_token'][$b]==$d){return TRUE;}return FALSE;}public static function hash($d){return md5(md5($d.Config::get('hash_salt')).$d);}public static function antiXss($d){if(self::$a===NULL){include(SYS_LIBS_PATH.'htmlpurifier'.DS.'HTMLPurifier.auto'.EXT);self::$a=new HTMLPurifier();}$e=self::$a->purify($d);return $e;}}